#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <Phonon>
#include <QNetworkAccessManager>
#include <QNetworkReply>

namespace Ui
{
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();


public:
    void keyPressEvent(QKeyEvent* event);


private:
    Ui::MainWindow *ui;


public slots:
    void play();
    void stateChanged(Phonon::State cur, Phonon::State old);
    void bufferStatus(int percentFilled);
    void mediaMetaDataChanged();
    void httpProgress(qint64 cur, qint64 total);

private:
    QNetworkAccessManager http;
    QNetworkReply* stream;
//    Phonon::VideoPlayer* player;
    Phonon::MediaObject* source;
    Phonon::AudioOutput* audio;
    Phonon::VideoWidget* video;
    bool loaded;

};

#endif // MAINWINDOW_H
